
<template>
  <div>
<h2>优惠券显示页面</h2>
<table border="1">
  <tr>
    <td>标题</td>
    <td>剩余数量</td>
    <td>每人限购</td>
    <td>适用门店</td>
    <td>消费满</td>
    <td>优惠券减去</td>
    <td>优惠券使用时间</td>
    <td>优惠券过期时间</td>
    <td>业务</td>
    <td>联系电话</td>
    <td>详情</td>
    <td>状态</td>
    <td>操作</td>
  </tr>
  <tr v-for="item in list">
    <td>{{ item.title}}</td>
    <td>{{ item.num }}</td>
    <td>{{ item.people }}</td>
    <td>{{ item.tYpe }}</td>
    <td>{{ item.price }}</td>
    <td>{{ item.jPrice }}</td>
    <td>{{ item.sdate.substr(0,10) }}</td>
    <td>{{ item.edate }}</td>
    <td>{{ item.yewu }}</td>
    <td>{{ item.phone }}</td>
    <td>{{ item.xiagqing }}</td>
    <td>{{ item.states==1?"上架":"下架" }}</td>
    <td>
      <input type="button" @click="updat" value="修改" >
    </td>
  </tr>
</table>
共有<span>3</span>条
每页显示<span>2</span>条
当前为第<span>1/2</span>页
<input type="button" value="首页">
<input type="button" value="上一页">
<input type="button" value="下一页">
<input type="button" value="尾页">
  </div>
</template>

<script setup lang="ts">
import { reactive,toRefs,onMounted } from 'vue';
import axios from 'axios';
import { useRoute,useRouter } from 'vue-router';
let route=useRoute();
let router=useRouter();
let data:(any)=reactive({
  state:{
  id:''
  },
  list:[]
})
let {state,list}=toRefs(data)
onMounted(()=>{
  Show()
})
    function updat()
    {
      alert("下架成功")
    }
function Show()
{
  axios({
    url:'/api/MenDian/GetPrick',
    method:'get',
    
  })
  .then(res=>{
    list.value=res.data.data
  })
  .catch(err=>{

  })
}
</script>

<style scoped>

</style>